package ca.jerg.config;

public class ErgConfigWorkDetails extends ErgConfig
{
	/*
	 * Default work intensity description.
	 */
	public static final String DEF_ANAEROBIC_DETAILS = "Max effort, incredibly uncomfortable.  Only sustainable for 1-2 minutes.";
	public static final String DEF_VO2_DETAILS = "Very hard effort.  Sustainable for periods of no longer then 10 minutes.";
	public static final String DEF_FT_DETAILS = "Hard effort.  Sustainable for peroids up to 60 minutes";
	public static final String DEF_TEMPO_DETAILS = "Moderately hard effort.  Sustainable for periods up to 120 minutes.";
	public static final String DEF_DISTANCE_DETAILS = "Steady effort.  Sustainable for long periods provided fueling is correct.";	
	
	private final String ERG_CFG_WORK_DETAILS_STR = "ErgCfgWorkDetails: ";	

	public ErgConfigWorkDetails()
	{
		super("WorkDetails");
		
		String s;
						
		/*
		 * The first time this class is loaded there is no
		 * stored Work Details configuration.  If, that is
		 * the case then create a setup using the default
		 * values.
		 */
		s = config.get(KEY_ANAEROBIC,null);
		if ( s == null )
			config.put(KEY_ANAEROBIC,DEF_ANAEROBIC_DETAILS);

		s = config.get(KEY_VO2,null);
		if ( s == null )
			config.put(KEY_VO2,DEF_VO2_DETAILS);
		
		s = config.get(KEY_FT,null);
		if ( s == null )
			config.put(KEY_FT,DEF_FT_DETAILS);
		
		s = config.get(KEY_TEMPO,null);
		if ( s == null )
			config.put(KEY_TEMPO,DEF_TEMPO_DETAILS);
		
		s = config.get(KEY_DISTANCE,null);
		if ( s == null )
			config.put(KEY_DISTANCE,DEF_DISTANCE_DETAILS);
	}

	
	public void defaults()
	{
		config.put(KEY_ANAEROBIC,DEF_ANAEROBIC_DETAILS);
		config.put(KEY_VO2,DEF_VO2_DETAILS);
		config.put(KEY_FT,DEF_FT_DETAILS);
		config.put(KEY_TEMPO,DEF_TEMPO_DETAILS);
		config.put(KEY_DISTANCE,DEF_DISTANCE_DETAILS);
	}

	
	public boolean getBoolean( String key, boolean def )
	{
		// no boolean values
		return false;
	}

	
	public double getDouble( String key, double def )
	{
		// no double values
		return 0;
	}

	
	public int getInt( String key, int def )
	{
		// no int values
		return 0;
	}

	
	public String getString( String key, String def )
	{
		return config.get(key,def);
	}

	
	public void put( String key, String value )
	{
		config.put(key,value);
	}

	
	public void putBoolean( String key, boolean value )
	{
		// no boolean values
	}

	
	public void putDouble( String key, double value )
	{
		// no double values
	}

	
	public void putInt( String key, int value )
	{
		// no int values
	}
}
